﻿$(document).ready(function () {
    $("#frmEditorLogin").submit(function (e) {
        $("#loginFailed").hide();

        //get the values
        var loginValues = $(this).serialize();
        $.post(pathPrefix + "Users/EditorLogin", loginValues, function (result) {
            //if the login result is true
            if (result.Key) {
                //move to specified page
                window.location = result.Value;
            }
            else {
                $("#loginFailed").show();
            }
        }, "json");

        e.preventDefault();
    });

    $("#Password").keydown(function () {
        $("#loginFailed").hide();
    });
});